package jiyun.com.yiyanmeng;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;

import java.util.List;

import bean.LunTanOffRecyBean;

public class OffLunTanDetailsedActivity extends AppCompatActivity {

    /**
     * 返回
     */
    private TextView mImageBack;
    /**  */
    private TextView mTvTitle;
    /**
     * 请输入评论
     */
    private TextView mTvComment;
    private ImageView mIvPingNum;
    /**
     * 举报
     */
    private TextView mJubao;
    private List <LunTanOffRecyBean.InfoBean.ArticleBean> list;
    /**
     * 123
     */
    private TextView mTitle;
    private ImageView mIv;
    /**
     * 123
     */
    private TextView mTv1;
    /**
     * 13
     */
    private TextView mTv3;
    /**
     * adasdfasdfasdfdsaf
     */
    private TextView mContent;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_off_lun_tan_detailsed);
        initView();
        initData();
    }

    private void initData() {
        Intent intent = getIntent();
        int position = intent.getIntExtra("position", 0);
        list = (List <LunTanOffRecyBean.InfoBean.ArticleBean>) intent.getSerializableExtra("list");
        mTitle.setText(list.get(position).getTitle());
        mContent.setText(list.get(position).getContent());
        RoundedCorners roundedCorners = new RoundedCorners(50);
        RequestOptions options = RequestOptions.bitmapTransform(roundedCorners);
        Glide.with(this).load(list.get(position).getAuthImg()).apply(options).into(mIv);
        mTv1.setText(list.get(position).getAuthName());
        mTv3.setText(list.get(position).getAddtime());
    }

    private void initView() {
        mImageBack = (TextView) findViewById(R.id.image_back);
        mImageBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        mTvTitle = (TextView) findViewById(R.id.tv_title);
        mTvTitle.setText("帖子详情");
        mTvComment = (TextView) findViewById(R.id.tv_comment);
        mIvPingNum = (ImageView) findViewById(R.id.iv_ping_num);
        mJubao = (TextView) findViewById(R.id.jubao);
        mTitle = (TextView) findViewById(R.id.title);
        mIv = (ImageView) findViewById(R.id.iv);
        mTv1 = (TextView) findViewById(R.id.tv1);
        mTv3 = (TextView) findViewById(R.id.tv3);
        mContent = (TextView) findViewById(R.id.content);
    }
}
